﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Proyecta.Data.Helpers
{
    public class QueryOrderedColumn : IGenerableQuery
    {
        public string Columna { get; set; }
        public OrderType TipoOrden { get; set; }

        internal QueryOrderedColumn(string columna, OrderType orden)
        {
            this.Columna = columna;
            this.TipoOrden = orden;
        }

        public void Generate(StringBuilder sql)
        {
            sql.Append(this.Columna);
            sql.Append(" ");
            sql.Append(this.TipoOrden == OrderType.Ascendente ? "ASC" : "DESC");
        }
    }
}